Skip to content

[ISSUE #11528] Lite topic consumption stalls until the invisible time expires when a pop response is lost - #11529

Open
f1amingo wants to merge 1 commit into
apache:developfrom
f1amingo:fix/lite-attempt-lease-release
Open

f1amingo wants to merge 1 commit into
apache:developfrom
f1amingo:fix/lite-attempt-lease-release

Conversation

@f1amingo

Copy link
Copy Markdown
Contributor

Which Issue(s) This PR Fixes

Brief Description

When a Lite pop response is lost, the lite topics it read stay leased to it and their events are already consumed, so the client's retry with the same attemptId cannot pick them up until the invisible time expires. This PR records, per client, the latest pop with an attemptId and the leases it takes. A retry of the same attemptId releases these leases without committing offset and re-dispatches them, so they are redelivered from the same offset in order. A pop superseded by a newer request of the client stops reading and passes on its events, and a lease it takes afterwards is released under the queue lock. Receipt handles of a released lease can no longer renew, suspend or commit offset. This assumes at most one pop with an attemptId in flight per client on a broker.

How Did You Test This Change?

Added PopLiteAttemptRecoveryTest and PopLiteMessageProcessorAttemptReleaseTest covering lost responses, overlapping pops and queue lock contention. Existing Lite, ChangeInvisibleTime and ConsumerOrderInfo tests pass.

…n retry

- Track the latest pop with an attemptId of each client and the leases it takes
- Release the unacked leases of an attempt on its retry without committing offset, and re-dispatch them
- Stop a pop superseded by a newer request, pass on its events and release a lease it takes afterwards
- Reject renewing or suspending a released lease
- Add unit tests for lease release and recovery
@f1amingo
f1amingo force-pushed the fix/lite-attempt-lease-release branch from e685056 to e7d16f3 Compare November 17, 2026 08:31
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.06557% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.99%. Comparing base (cb0dfc2) to head (e7d16f3).

Files with missing lines Patch % Lines
...etmq/broker/processor/PopLiteMessageProcessor.java 87.50% 7 Missing and 6 partials ⚠️
.../broker/offset/MemoryConsumerOrderInfoManager.java 71.42% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #11529      +/-   ##
=============================================
+ Coverage      49.79%   49.99%   +0.20%     
- Complexity     14419    14496      +77     
=============================================
  Files           1391     1391              
  Lines         103381   103494     +113     
  Branches       13529    13556      +27     
=============================================
+ Hits           51477    51742     +265     
+ Misses         45684    45518     -166     
- Partials        6220     6234      +14     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Lite topic consumption stalls until the invisible time expires when a pop response is lost

2 participants